package com.wfy.api;

import com.wfy.pojo.PageResult;
import com.wfy.pojo.Sku;
import com.wfy.pojo.TbSpuDetail;
import com.wfy.pojo.vo.SpuVo;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Title: GoodsApi
 * @Package com.wfy.api
 * @Author 王飞遥
 * @Date 2022/9/16 11:46
 */

public interface GoodsApi {
    //分页查询商品的接口
    @GetMapping("/spu/page")
     PageResult<SpuVo> querySpuVoPage(
            @RequestParam(value = "key",required = false)String key,
            @RequestParam(value = "saleable",required = false) Boolean saleable,
            @RequestParam(value = "page",defaultValue = "1") Integer page,
            @RequestParam(value = "rows",defaultValue = "5") Integer rows
    );

    /**
     * 通过spuId查询spuDetail的详情
     * @param spuId
     * @return
     */
    @GetMapping("/spu/detail/{spuId}")
     TbSpuDetail queryDetailBySpuId(@PathVariable("spuId")Long spuId);

    /**
     * 通过spuID查询skus的列表数据
     * @param id
     * @return
     */
    @GetMapping("/sku/list")
    List<Sku> querySkuListBySpuId(@RequestParam("id")Long id);
}
